/*
 * Copyright 2009 Xplayat, S.L. All rights reserved.
 * Propiedad de Xplayat. 
 */
package facelets.component;

import org.apache.myfaces.custom.picklist.HtmlSelectManyPicklist;

import com.sun.facelets.tag.jsf.ComponentConfig;
import com.sun.facelets.tag.jsf.ComponentHandler;

/**
 * @author karpu
 *
 */
public class PickListComponentHandler extends ComponentHandler { // NO_UCD
	
	
	public PickListComponentHandler(ComponentConfig cfg) {
		super(cfg);
	}
	
	
	/* (non-Javadoc)
	 * @see com.sun.facelets.tag.MetaTagHandler#setAttributes(com.sun.facelets.FaceletContext, java.lang.Object)
	 */
	public void setAttributes(com.sun.facelets.FaceletContext ctx, Object instance) {
		HtmlSelectManyPicklist t = (HtmlSelectManyPicklist) instance;

		if ( getAttribute ("addButtonStyleClass") == null ) 
			t.setAddButtonStyleClass("pickButton");
		
		if ( getAttribute ("addAllButtonStyleClass") == null ) 
			t.setAddAllButtonStyleClass("pickButton");
		
		if ( getAttribute ("removeButtonStyleClass") == null ) 
			t.setRemoveButtonStyleClass("pickButton");
		
		if ( getAttribute ("removeAllButtonStyleClass") == null ) 
			t.setRemoveAllButtonStyleClass("pickButton");
		
		
		super.setAttributes(ctx, instance);
	}
}